import Vue from 'vue'

import axios from 'axios'
////引入vue-axios插件后，就不需要将axios绑定到Vue的原型链上了
import VueAxios from 'vue-axios'

Vue.use(VueAxios, axios)


axios.defaults.withCredentials = false  //跨域时是否需要凭证
axios.defaults.timeout = 8000;  //超时时间
// axios.defaults.baseURL = "http://121.41.95.123" //基准地址

//请求拦截器
axios.interceptors.request.use(config =>{
  //为请求头配置Token验证的Authorization
  config.headers.Authorization = "Bearer " + window.sessionStorage.getItem("token");
  return config;
})
